<!--资源投放后显示-->
<template>
  <div class="rsr-container">
    <div class="rsr-item" v-for="vi in dataList" :key="vi.id" @click="clickRsr(vi.resourceId)">
      <img :src="vi.img" />
      <el-tooltip effect="dark" placement="bottom">
        <div slot="content">{{ vi.name }}</div>
        <span>{{ vi.segmentName }}</span>
      </el-tooltip>
    </div>
  </div>
</template>

<script>
import clickEvents from '@/mixins/rsr-slot';
export default {
  name: 'rsr-slot',
  mixins: [clickEvents],
  data() {
    return {
      dims: sa.$sys.getCurd(),
      loading: false,
      dataList: {
        type: Array,
        default: []
      }
    }
  },
  created() {
    this.getSlotRsr();
  },
}
</script>

<style lang="scss" scoped>
.rsr-container {
  --hover-color: #00a04d;
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;

  .rsr-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    width: 160px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;

    img {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      margin-right: 8px;
      image-rendering: crisp-edges;
      transition: transform 0.2s ease;
    }

    &:hover {
      color: var(--hover-color);
      font-weight: 500;
      background: rgba(0, 160, 77, 0.05);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);

      img {
        transform: scale(1.05);
      }
    }
  }
}
</style>
